package org.smr.ministore.micro.client;

import org.blade.utils.Pager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.smr.ministore.entities.GoodsTypeOrgan;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.List;
import java.util.Map;

import feign.hystrix.FallbackFactory;


@Component
public class HystrixGoodsTypeOrganClientFactory implements FallbackFactory<FeignGoodsTypeOrganMicroServiceClient> {

    private static final Logger LOGGER = LoggerFactory.getLogger(HystrixGoodsTypeOrganClientFactory.class);

    @Override
    public FeignGoodsTypeOrganMicroServiceClient create(Throwable cause) {
    HystrixGoodsTypeOrganClientFactory.LOGGER.info("fallback; reason was: {}", cause.getMessage());

        return new FeignGoodsTypeOrganMicroServiceClient() {

            @Override
            public int batchSave(List<GoodsTypeOrgan> entities) {
                return 0;
                }

            @Override
            public int batchModify(List<GoodsTypeOrgan> entities) {
                return 0;
                }

            @Override
            public int save(GoodsTypeOrgan entity) {
            return 0;
            }

            @Override
            public int updateById(GoodsTypeOrgan id) {
            return 0;
            }

            @Override
            public GoodsTypeOrgan queryById(Long id) {
            return null;
            }

            @Override
            public int deleteById(Long id) {
            return 0;
            }

            @Override
            public Pager<GoodsTypeOrgan> paginate(GoodsTypeOrgan entity, Long pageSize, Long pageNum) {
                Pager<GoodsTypeOrgan> pager = new Pager<GoodsTypeOrgan>();
                    return pager;
            }

        };//Return end
    }
}